home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.input;
-
- import sub_arctic.lib.interactor;
-
- import java.util.Vector;
-
- /**
- * Object for building and holding a set of interactor objects picked by
- * a point. This class maintains an ordered list of "user_info_holder"
- * objects each of which represents an interactor object along with optional
- * user information that interactor has saved about the details of the pick.
- * This user information is passed back to object when input is delivered to
- * them.
- *
- * @author Scott Hudson
- */
- public class pick_collector {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Internal Vector to hold our picked objects. This holds
- * user_info_holder objects. */
- protected Vector _pick_list;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Simple constructor */
- public pick_collector()
- {
- _pick_list = new Vector();
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Total number of picks we currently have. */
- public int num_picks() { return _pick_list.size(); }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Retrieve the ith user_info_holder object from the current collection
- * of picks.
- *
- * @param int indx index of object we want.
- * @return user_info_holder the object at that index.
- */
- public user_info_holder pick(int indx)
- {
- return (user_info_holder)_pick_list.elementAt(indx);
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Add the given object (with optional additional information) to the
- * end of the current pick collection.
- *
- * @param interactor in_obj the object being added as a pick.
- * @param Object user_info uninterpreted user information to be
- * associated with that object and returned to
- * it when input associated with this pick is
- * delivered to it.
- */
- public void report_pick(interactor in_obj, Object user_info)
- {
- _pick_list.addElement(new user_info_holder(in_obj,user_info));
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Add the given object to the end of the current pick collection. The
- * optional user information associated with the pick will be set to null.
- *
- * @param interactor in_obj the object being added as a pick.
- */
- public void report_pick(interactor in_obj)
- {
- _pick_list.addElement(new user_info_holder(in_obj,null));
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Reset the pick collection to empty. */
- public void reset()
- {
- _pick_list.removeAllElements();
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-